home *** CD-ROM | disk | FTP | other *** search
Text File | 1992-06-18 | 486 b | 25 lines | [TEXT/MPS ] |
- #define SystemSevenOrLater 1
-
- #include <files.h>
- #include <folders.h>
-
- #include "getfoldername.h"
-
- OSErr getfoldername( OSType id, Str255& name )
- {
- CInfoPBRec pb;
- pb.dirInfo.ioCompletion = 0;
- pb.dirInfo.ioNamePtr = (StringPtr)&name;
- pb.dirInfo.ioFDirIndex = -1;
-
- OSErr error = FindFolder( kOnSystemDisk,
- id,
- 0,
- &pb.dirInfo.ioVRefNum,
- &pb.dirInfo.ioDrDirID );
- if (error != noErr)
- return error;
-
- return PBGetCatInfoSync( &pb );
- }
-